home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 236 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1007 b 

  1. Path: newsource.ihug.co.nz!news
  2. From: dongf@pcnet.co.nz (Dong-Hang Fong)
  3. Newsgroups: comp.programming,comp.lang.c++,comp.lang.pascal.misc
  4. Subject: Re: How to convert octal-binary?
  5. Date: Wed, 03 Jan 1996 08:15:30 GMT
  6. Organization: The Internet Group
  7. Message-ID: <4ceoi9$5ra@newsource.ihug.co.nz>
  8. References: <4c0nhf$hnl@nyheter.chalmers.se>
  9. NNTP-Posting-Host: 206.101.216.24
  10. X-Newsreader: Forte Free Agent 1.0.82
  11.  
  12. christian.almstrand@elektro.ing.hb.se (Cristian Almstrand) wrote:
  13.  
  14. >I really need to know if someone knows about any algoritm to
  15. >convert from a octal value to a hexadecimal or binary?
  16.  
  17. >If you know where to find such an iformation - please let me know.
  18. >All hints are welcome.
  19.  
  20. >Thanks,
  21. >Cristian
  22.  
  23. Well, each digit of octal number can be imaged into a three- digit
  24. binary number.
  25. 0 ---- 000, 1 ----- 001, 2 ----- 010, 3 ----- 011, 4 ----- 100, 5
  26. ----- 101, 6 ----- 110, 7 ----- 111.
  27. So, you can convert a octal value to a binary one directly.
  28. e.g.
  29. 123o = 001 010 011b
  30.  
  31. Cheers,
  32. Dong-Hang Fong
  33.  
  34.